<?php

// 观察者
abstract class Observer
{
    protected $name;
    protected $subject;

    // 使用了具体实现类SubjectSecretary，为了降低耦合使用Subject抽象类代替SubjectSecretary
    public function __construct($name, Subject $subject)
    {
        $this->name = $name;
        $this->subject = $subject;
    }

    public abstract function update();
}